package com.example.finalwork06.Controller;

import com.example.finalwork06.Common.Result;
import com.example.finalwork06.Entity.PageBean;
import com.example.finalwork06.Service.ChinaIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/indexes")
public class ChinaIndexController {
    @Autowired
    private ChinaIndexService chinaIndexService;
    @GetMapping
    public Result page(@RequestParam(defaultValue = "1")Integer page,
                       @RequestParam(defaultValue = "10")Integer pageSize){

        PageBean pageBean=chinaIndexService.page(page,pageSize);
        return Result.success(pageBean);
    }
}
